import Vue from 'vue'
import Router from 'vue-router'
import Home from './components/tabbar/Home.vue'
import Search from './components/tabbar/Search.vue'
import Cart from './components/tabbar/Cart.vue'
import Xwzx from './components/news/Xwzx.vue'
import Xwzxq from './components/news/Xwzxq.vue'
import Vimgs from './components/vimgs/Vimg.vue'
import Vtits from './components/vimgs/Vtits.vue'
import Goods from './components/goods/Goodslist.vue'
import Goodsinfo from './components/goods/Goodsinfo.vue'
import Goodsdesc from './components/goods/Goodsdesc.vue'
import Goodscomment from './components/goods/Goodscomment.vue'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: Home
    },
    {
      path: '/about',
      name: 'contact',
      component: () => import('./components/tabbar/About.vue')
    },
    {
      path: '/search',
      name: 'search',
      component: Search
    },
    {
      path: '/cart',
      name: 'cart',
      component: Cart
    },
    {
      path: '/home/xwzx',
      name: 'xwzx',
      component: Xwzx
    },
    {
      path: '/home/xwzxq/:id',
      component: Xwzxq
    },
    {
      path: '/home/vimg',
      name: 'vimgs',
      component: Vimgs
    },
    {
      path: '/home/vtits:id',
      component: Vtits
    },
    {
      path: '/home/goods',
      name: 'goods',
      component: Goods
    },
    {
      path: '/home/goodsinfo:id',
      name: 'goodsinfo',
      component: Goodsinfo
    },
    {
      path: '/home/goodsdesc:id',
      name: 'goodsdesc',
      component: Goodsdesc
    },
    {
      path: '/home/goodscomment:id',
      name: 'goodscomment',
      component: Goodscomment
    }
  ],
  // 覆盖默认路由高亮类
  linkActiveClass: 'mui-active'
})
